From b3b8d978d28b878365031adead4d5849f3d68486 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Wed, 19 Aug 2009 00:28:57 +0000 Subject: [PATCH] * language updates and fixes/enhancements to js/php merge system --- js2/mwEmbed/libAddMedia/mvAdvFirefogg.js | 14 ++--- .../libAddMedia/mvBaseUploadInterface.js | 51 +++++++--------- js2/mwEmbed/libAddMedia/mvFirefogg.js | 26 ++++---- js2/mwEmbed/libAddMedia/remoteSearchDriver.js | 40 ++++++------ .../libAddMedia/searchLibs/metavidSearch.js | 2 +- js2/mwEmbed/libAddMedia/simpleUploadForm.js | 14 ++--- js2/mwEmbed/libClipEdit/mvClipEdit.js | 47 +++++++------- js2/mwEmbed/libEmbedVideo/embedVideo.js | 61 +++++++------------ js2/mwEmbed/libSequencer/mvSequencer.js | 24 +++----- .../libSequencer/mvTimedEffectsEdit.js | 12 ++-- js2/mwEmbed/libTimedText/mvTextInterface.js | 2 - js2/mwEmbed/mv_embed.js | 9 ++- js2/mwEmbed/php/languages/mwEmbed.i18n.php | 1 - .../php/maintenance/mergeJavascriptMsg.php | 21 +++++-- 14 files changed, 146 insertions(+), 178 deletions(-) diff --git a/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js b/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js index beb1c6db60..944f99ea10 100644 --- a/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js @@ -5,14 +5,14 @@ //@@todo put all msg text into loadGM json loadGM({ - "help-sticky": "Help (click to stick)", - "fogg-cg-preset": "Preset: $1", - "fogg-cg-quality": "Basic quality and resolution control", - "fogg-cg-meta": "Metadata for the clip", + "help-sticky" : "Help (click to stick)", + "fogg-cg-preset" : "Preset : $1<\/strong>", + "fogg-cg-quality" : "Basic quality and resolution control", + "fogg-cg-meta" : "Metadata for the clip", "fogg-cg-range" : "Encoding range", - "fogg-cg-advVideo": "Advanced video encoding controls", - "fogg-cg-advAudio": "Advanced audio encoding controls", - "fogg-preset-custom": "Custom settings" + "fogg-cg-advVideo" : "Advanced video encoding controls", + "fogg-cg-advAudio" : "Advanced audio encoding controls", + "fogg-preset-custom" : "Custom settings" }); var mvAdvFirefogg = function( iObj ){ diff --git a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js index b39283e062..5f7b7bf839 100644 --- a/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js +++ b/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js @@ -4,40 +4,31 @@ * this base uploader is optionally extended by firefogg */ loadGM({ - "upload-transcode-in-progress": "Transcode and upload in progress (do not close this window)", - "upload-in-progress": "Upload in progress (do not close this window)", - "upload-transcoded-status": "Transcoded", - "uploaded-status": "Uploaded", - - "wgfogg_wrong_version": "You have Firefogg installed but it is outdated. Please upgrade.", - "upload-stats-fileprogres": "$1 of $2", - - "mv_upload_completed": "Your upload is complete", - - "mv_upload_done": "Your upload should be accessible.", - "upload-unknown-size": "Unknown size", - - "mv-cancel-confim" : "Are you sure you want to cancel?", - - "successfulupload": "Upload successful", + "upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)", + "upload-in-progress" : "Upload in progress (do not close this window)", + "upload-transcoded-status" : "Transcoded", + "uploaded-status" : "Uploaded", + "wgfogg_wrong_version" : "You have Firefogg installed but it is outdated. Please upgrade<\/a>.", + "upload-stats-fileprogres" : "$1 of $2", + "mv_upload_completed" : "Your upload is complete", + "mv_upload_done" : "Your upload should be<\/i> accessible<\/a>.", + "upload-unknown-size" : "Unknown size", + "mv-cancel-confim" : "Are you sure you want to cancel?", + "successfulupload" : "Upload successful", "uploaderror" : "Upload error", - "uploadwarning": "Upload warning", - "unknown-error": "Unknown error:", - "return-to-form": "Return to form", - - "file-exists-duplicate": "This file is a duplicate of the following file:", - "fileexists" : "A file with this name exists already. Please check $1 if you are not sure if you want to change it.", - "fileexists-thumb": "
Existing file
", + "uploadwarning" : "Upload warning", + "unknown-error" : "Unknown error : ", + "return-to-form" : "Return to form", + "file-exists-duplicate" : "This file is a duplicate of the following file : ", + "fileexists" : "A file with this name exists already. Please check $1<\/tt><\/b> if you are not sure if you want to change it.", + "fileexists-thumb" : "
Existing file<\/b><\/center>", "ignorewarning" : "Ignore warning and save file anyway", - "file-thumbnail-no" : "The filename begins with $1", + "file-thumbnail-no" : "The filename begins with $1<\/tt><\/b>", "go-to-resource" : "Go to resource page", "upload-misc-error" : "Unknown upload error", - - "wgfogg_waring_bad_extension" : "You have selected a file with an unsuported extension (more information).", - - "cancel-button" : "Cancel", - "ok-button" : "OK" - + "wgfogg_waring_bad_extension" : "You have selected a file with an unsuported extension (more information<\/a>).", + "cancel-button" : "Cancel", + "ok-button" : "OK" }); diff --git a/js2/mwEmbed/libAddMedia/mvFirefogg.js b/js2/mwEmbed/libAddMedia/mvFirefogg.js index e8bb61c1ac..437e2b1a2a 100644 --- a/js2/mwEmbed/libAddMedia/mvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvFirefogg.js @@ -3,19 +3,19 @@ */ loadGM({ - "fogg-select_file": "Select file", - "fogg-select_new_file": "Select new file", - "fogg-select_url": "Select URL", - "fogg-save_local_file": "Save Ogg", - "fogg-check_for_fogg": "Checking for Firefogg ...", - "fogg-installed": "Firefogg is installed", - "fogg-for_improved_uplods": "For improved uploads:", - "fogg-please_install": "Install Firefogg. More about Firefogg", - "fogg-use_latest_fox": "Please first install Firefox 3.5 (or later). Then revisit this page to install the Firefogg extension.", - "fogg-passthrough_mode": "Your selected file is already Ogg or not a video file", - "fogg-transcoding": "Encoding video to Ogg", - "fogg-encoding-done": "Encoding complete", - "fogg-badtoken": "Token is not valid" + "fogg-select_file" : "Select file", + "fogg-select_new_file" : "Select new file", + "fogg-select_url" : "Select URL", + "fogg-save_local_file" : "Save Ogg", + "fogg-check_for_fogg" : "Checking for Firefogg ...<\/blink>", + "fogg-installed" : "Firefogg is installed", + "fogg-for_improved_uplods" : "For improved uploads : ", + "fogg-please_install" : "Install Firefogg<\/a>. More about Firefogg<\/a>", + "fogg-use_latest_fox" : "Please first install Firefox 3.5<\/a> (or later). Then revisit this page to install the Firefogg<\/b> extension.<\/i>", + "fogg-passthrough_mode" : "Your selected file is already Ogg or not a video file", + "fogg-transcoding" : "Encoding video to Ogg", + "fogg-encoding-done" : "Encoding complete", + "fogg-badtoken" : "Token is not valid" }); var firefogg_install_links = { diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index 57c21b9b89..3cf68daaec 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -8,35 +8,31 @@ and archive.org */ loadGM({ - "add_media_wizard": "Add media wizard", + "add_media_wizard" : "Add media wizard", "mv_media_search" : "Media search", "rsd_box_layout" : "Box layout", "rsd_list_layout" : "List layout", "rsd_results_desc" : "Results", "rsd_results_next" : "next", "rsd_results_prev" : "previous", - "rsd_no_results" : "No search results for $1", - + "rsd_no_results" : "No search results for $1<\/b>", "upload_tab" : "Upload", - "rsd_layout" : "Layout:", - "rsd_resource_edit" : "Edit resource: $1", - "resource_description_page": "Resource description page", - "rsd_local_resource_title": "Local resource title", - "rsd_do_insert": "Do insert", - - "cc_title": "Creative Commons", - "cc_by_title": "Attribution", - "cc_nc_title": "Noncommercial", - "cc_nd_title": "No Derivative Works", - "cc_sa_title": "Share Alike", - "cc_pd_title": "Public Domain", - "unknown_license": "Unknown license", - "no_import_by_url": "This user or wiki can not import assets from remote URLs.

Do you need to login?

If permissions are set, you may have to enable $wgAllowCopyUploads (more information).

", - "results_from": "Results from $2", - - "missing_desc_see_soruce": "This asset is missing a description. Please see the [$1 orginal source] and help describe it.", - - "rsd_config_error": "Add media wizard configuration error: $1" + "rsd_layout" : "Layout : ", + "rsd_resource_edit" : "Edit resource : $1", + "resource_description_page" : "Resource description page", + "rsd_local_resource_title" : "Local resource title", + "rsd_do_insert" : "Do insert", + "cc_title" : "Creative Commons", + "cc_by_title" : "Attribution", + "cc_nc_title" : "Noncommercial", + "cc_nd_title" : "No Derivative Works", + "cc_sa_title" : "Share Alike", + "cc_pd_title" : "Public Domain", + "unknown_license" : "Unknown license", + "no_import_by_url" : "This user or wiki can not<\/b> import assets from remote URLs.<\/p>

Do you need to login?<\/p>

If permissions are set, you may have to enable $wgAllowCopyUploads (more information<\/a>).<\/p>", + "results_from" : "Results from $2<\/a>", + "missing_desc_see_soruce" : "This asset is missing a description. Please see the [$1 orginal source] and help describe it.", + "rsd_config_error" : "Add media wizard configuration error : $1" }); var default_remote_search_options = { 'profile':'mediawiki_edit', diff --git a/js2/mwEmbed/libAddMedia/searchLibs/metavidSearch.js b/js2/mwEmbed/libAddMedia/searchLibs/metavidSearch.js index 5fcc4586e0..b043dfd240 100644 --- a/js2/mwEmbed/libAddMedia/searchLibs/metavidSearch.js +++ b/js2/mwEmbed/libAddMedia/searchLibs/metavidSearch.js @@ -1,7 +1,7 @@ /* * api modes (implementations should call these objects which inherit the mvBaseRemoteSearch */ -loadGM( { +loadGM({ "mv_stream_title" : "$1 $2 to $3" }); var metavidSearch = function(iObj) { diff --git a/js2/mwEmbed/libAddMedia/simpleUploadForm.js b/js2/mwEmbed/libAddMedia/simpleUploadForm.js index 6f2ea37742..ec8a784b7f 100644 --- a/js2/mwEmbed/libAddMedia/simpleUploadForm.js +++ b/js2/mwEmbed/libAddMedia/simpleUploadForm.js @@ -6,13 +6,13 @@ loadGM({ "select_file" : "Select file", - "more_licence_options" : "For more licence options, view the normal upload page", - "select_ownwork": "I am uploading entirely my own work, and licencing it under:", - "licence_cc-by-sa": "Creative Commons Share Alike (3.0)", - "upload": "Upload file", - "destfilename": "Destination filename:", - "summary": "Summary", - "error_not_loggedin": "You do not appear to be logged in or do not have upload privlages." + "more_licence_options" : "For more licence options, view the normal upload page<\/a>", + "select_ownwork" : "I am uploading entirely my own work, and licencing it under : ", + "licence_cc-by-sa" : "Creative Commons Share Alike (3.0)", + "upload" : "Upload file", + "destfilename" : "Destination filename : ", + "summary" : "Summary", + "error_not_loggedin" : "You do not appear to be logged in or do not have upload privlages." }); var default_form_options = { diff --git a/js2/mwEmbed/libClipEdit/mvClipEdit.js b/js2/mwEmbed/libClipEdit/mvClipEdit.js index cf8db1d08d..d47c1d517d 100644 --- a/js2/mwEmbed/libClipEdit/mvClipEdit.js +++ b/js2/mwEmbed/libClipEdit/mvClipEdit.js @@ -6,31 +6,28 @@ 'audio':0 //should allow controlling the audio volume (with keyframes) */ //set gMsg object: -loadGM( { - "mv_crop": "Crop image", - "mv_apply_crop": "Apply crop to image", - "mv_reset_crop": "Reset crop", - "mv_insert_image_page": "Insert into page", - "mv_insert_into_sequence": "Insert into sequence", - "mv_preview_insert": "Preview insert", - "mv_cancel_image_insert": "Cancel insert", - - "sc_fileopts": "Clip detail edit", - "sc_inoutpoints": "Set in-out points", - "sc_overlays": "Overlays", - "sc_audio": "Audio control", - "sc_duration": "Duration", - - "mv_template_properties": "Template properties", - "mv_custom_title": "Custom title", - "mv_edit_properties": "Edit properties", - "mv_other_properties": "Other properties", - "mv_resource_page": "Resource page:", - - "mv_set_in_out_points": "Set in-out points", - "mv_start_time": "Start time", - "mv_end_time": "End time", - "mv_preview_inout": "Preview/play in-out points" +loadGM({ + "mv_crop" : "Crop image", + "mv_apply_crop" : "Apply crop to image", + "mv_reset_crop" : "Reset crop", + "mv_insert_image_page" : "Insert into page", + "mv_insert_into_sequence" : "Insert into sequence", + "mv_preview_insert" : "Preview insert", + "mv_cancel_image_insert" : "Cancel insert", + "sc_fileopts" : "Clip detail edit", + "sc_inoutpoints" : "Set in-out points", + "sc_overlays" : "Overlays", + "sc_audio" : "Audio control", + "sc_duration" : "Duration", + "mv_template_properties" : "Template properties", + "mv_custom_title" : "Custom title", + "mv_edit_properties" : "Edit properties", + "mv_other_properties" : "Other properties", + "mv_resource_page" : "Resource page : ", + "mv_set_in_out_points" : "Set in-out points", + "mv_start_time" : "Start time", + "mv_end_time" : "End time", + "mv_preview_inout" : "Preview\/play in-out points" }); var default_clipedit_values = { diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index f5dffff3d7..6e4d5f772a 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -3,50 +3,37 @@ */ loadGM({ - "loading_plugin" : "loading plugin ...", - + "loading_plugin" : "loading plugin ...<\/blink>", "select_playback" : "Set playback preference", "link_back" : "Link back", - "error_load_lib" : "Error: mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.", - - "error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface", - + "error_load_lib" : "Error : mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.", + "error_swap_vid" : "Error : mv_embed was unable to swap the video tag for the mv_embed interface", "add_to_end_of_sequence" : "Add to end of sequence", - "missing_video_stream" : "The video file for this stream is missing", - "play_clip" : "Play clip", - "pause_clip": "Pause clip", - "volume_control": "Volume control", - "player_options": "Player options", - "closed_captions": "Close captions", - "player_fullscreen": "Fullscreen", - + "pause_clip" : "Pause clip", + "volume_control" : "Volume control", + "player_options" : "Player options", + "closed_captions" : "Close captions", + "player_fullscreen" : "Fullscreen", "next_clip_msg" : "Play next clip", "prev_clip_msg" : "Play previous clip", "current_clip_msg" : "Continue playing this clip", "seek_to" : "Seek to", - - "download_segment" : "Download selection:", - "download_full" : "Download full video file:", - "download_right_click": "To download right click and select Save target as...", + "download_segment" : "Download selection : ", + "download_full" : "Download full video file : ", + "download_right_click" : "To download, right click and select Save target as...<\/i>", "download_clip" : "Download video", - "download_text" : "Download text (CMML xml):", - "download" : "Download", - - "share" : "Share", - "credits" : "Credits", - + "download_text" : "Download text (CMML<\/a> xml) : ", + "download" : "Download", + "share" : "Share", + "credits" : "Credits", "clip_linkback" : "Clip source page", - "chose_player" : "Choose video player", - + "chose_player" : "Choose video player", "share_this_video" : "Share this video", - "video_credits" : "Video credits", - - "menu_btn" : "Menu", - "close_btn" : "Close", - - + "video_credits" : "Video credits", + "menu_btn" : "Menu", + "close_btn" : "Close", "mv_ogg-player-vlc-mozilla" : "VLC plugin", "mv_ogg-player-videoElement" : "Native Ogg video support", "mv_ogg-player-vlc-activex" : "VLC ActiveX", @@ -57,12 +44,10 @@ loadGM({ "mv_ogg-player-flowplayer" : "Flowplayer", "mv_ogg-player-selected" : " (selected)", "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis", - "mv_generic_missing_plugin" : "You browser does not appear to support the following playback type: $1
Visit the
Playback Methods page to download a player.
", - - "mv_for_best_experience": "For a better video playback experience we recommend:
Firefox 3.5.", - "mv_do_not_warn_again": "Dissmiss for now.", - - "players": "Players" + "mv_generic_missing_plugin" : "You browser does not appear to support the following playback type : $1<\/b>
Visit the Playback Methods<\/a> page to download a player.
", + "mv_for_best_experience" : "For a better video playback experience we recommend :
Firefox 3.5<\/a>.<\/b>", + "mv_do_not_warn_again" : "Dissmiss for now.", + "players" : "Players" }); var default_video_attributes = { diff --git a/js2/mwEmbed/libSequencer/mvSequencer.js b/js2/mwEmbed/libSequencer/mvSequencer.js index b6f0ec680f..2a4fb181bb 100644 --- a/js2/mwEmbed/libSequencer/mvSequencer.js +++ b/js2/mwEmbed/libSequencer/mvSequencer.js @@ -24,19 +24,15 @@ loadGM({ "menu_cliplib" : "Add media", "menu_resource_overview" : "Resource overview", "menu_options" : "Options", - - "loading_timeline" : "Loading timeline ...", - "loading_user_rights" : "Loading user rights ...", - + "loading_timeline" : "Loading timeline ...<\/blink>", + "loading_user_rights" : "Loading user rights ...<\/blink>", "no_edit_permissions" : "You do not have permissions to save changes to this sequence", - "edit_clip" : "Edit clip", "edit_save" : "Save sequence changes", - "saving_wait": "Save in progress (please wait)", - "save_done" : "Save complete", + "saving_wait" : "Save in progress (please wait)", + "save_done" : "Save complete", "edit_cancel" : "Cancel sequence edit", "edit_cancel_confirm" : "Are you sure you want to cancel your edit? Changes will be lost.", - "zoom_in" : "Zoom in", "zoom_out" : "Zoom out", "cut_clip" : "Cut clips", @@ -47,20 +43,16 @@ loadGM({ "rmclip" : "Remove clip", "clip_in" : "clip in", "clip_out" : "clip out", - - "mv_welcome_to_sequencer" : "

Welcome to the sequencer demo

Very limited functionality right now. Not much documentation yet either.", - - "no_selected_resource" : "

No resource selected

Select a clip to enable editing.", - "error_edit_multiple" : "

Multiple resources selected

Select a single clip to edit it.", - + "mv_welcome_to_sequencer" : "

Welcome to the sequencer demo<\/h3> Very limited<\/b> functionality right now. Not much documentation yet either.", + "no_selected_resource" : "

No resource selected<\/h3> Select a clip to enable editing.", + "error_edit_multiple" : "

Multiple resources selected<\/h3> Select a single clip to edit it.", "mv_editor_options" : "Editor options", "mv_editor_mode" : "Editor mode", "mv_simple_editor_desc" : "simple editor (iMovie style)", "mv_advanced_editor_desc" : "advanced editor (Final Cut style)", "mv_other_options" : "Other options", "mv_contextmenu_opt" : "Enable context menus", - - "mv_sequencer_credit_line":"Developed by Kaltura, Inc. in partnership with the Wikimedia Foundation (more information)." + "mv_sequencer_credit_line" : "Developed by Kaltura, Inc.<\/a> in partnership with the Wikimedia Foundation<\/a> (more information<\/a>)." }); //used to set default values and validate the passed init object var sequencerDefaultValues = { diff --git a/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js b/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js index fa2956edde..50644ffc53 100644 --- a/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js +++ b/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js @@ -7,12 +7,12 @@ //add our local msgs loadGM({ - "transition_in": "Transition in", - "transition_out": "Transition out", - "effects": "Effects stack", - "remove_transition": "Remove transition", - "edit_transin": "Edit transition into clip", - "edit_transout": "Edit transition out of clip" + "transition_in" : "Transition in", + "transition_out" : "Transition out", + "effects" : "Effects stack", + "remove_transition" : "Remove transition", + "edit_transin" : "Edit transition into clip", + "edit_transout" : "Edit transition out of clip" }); diff --git a/js2/mwEmbed/libTimedText/mvTextInterface.js b/js2/mwEmbed/libTimedText/mvTextInterface.js index a74cbf49fc..1423b97d66 100644 --- a/js2/mwEmbed/libTimedText/mvTextInterface.js +++ b/js2/mwEmbed/libTimedText/mvTextInterface.js @@ -1,11 +1,9 @@ loadGM({ - "select_transcript_set" : "Select layers", "auto_scroll" : "auto scroll", "close" : "close", "improve_transcript" : "Improve" - }) // text interface object (for inline display captions) var mvTextInterface = function( parentEmbed ){ diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index 1149bddf52..ad338c087c 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -62,7 +62,7 @@ if( !mv_embed_path ){ } //setup the skin path: -var mv_jquery_skin_path = mv_embed_path + 'jquery/jquery.ui/themes/redmond/'; +var mv_jquery_skin_path = mv_embed_path + 'jquery/jquery.ui/themes/base/'; var mv_skin_img_path = mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/images/'; var mv_default_thumb_url = mv_skin_img_path + 'vid_default_thumb.jpg'; @@ -79,9 +79,8 @@ function loadGM( msgSet ){ //all default msg in [English] should be overwritten by the CMS language msg system. loadGM({ - "loading_txt":"loading ...", - "loading_title" : "Loading...", - + "loading_txt" : "loading ...<\/blink>", + "loading_title" : "Loading...", "size-gigabytes" : "$1 GB", "size-megabytes" : "$1 MB", "size-kilobytes" : "$1 K", @@ -218,7 +217,7 @@ lcPaths({ //depencency mapping for css files for self contained included plugins: lcCssPath({ '$j.Jcrop' : 'libClipEdit/Jcrop/css/jquery.Jcrop.css', - '$j.fn.ColorPicker' : 'libClipEdit/colorpicker/css/colorpicker.css' + '$j.fn.ColorPicker' : 'libClipEdit/colorpicker/css/colorpicker.css' }) /** diff --git a/js2/mwEmbed/php/languages/mwEmbed.i18n.php b/js2/mwEmbed/php/languages/mwEmbed.i18n.php index e96b2c5ce2..8a87cc76e8 100644 --- a/js2/mwEmbed/php/languages/mwEmbed.i18n.php +++ b/js2/mwEmbed/php/languages/mwEmbed.i18n.php @@ -258,4 +258,3 @@ Insert script via DOM has failed. Please try reloading this page.', 'size-kilobytes' => '$1 K', 'size-bytes' => '$1 B', ); - \ No newline at end of file diff --git a/js2/mwEmbed/php/maintenance/mergeJavascriptMsg.php b/js2/mwEmbed/php/maintenance/mergeJavascriptMsg.php index 70f885548e..c8b10e7684 100644 --- a/js2/mwEmbed/php/maintenance/mergeJavascriptMsg.php +++ b/js2/mwEmbed/php/maintenance/mergeJavascriptMsg.php @@ -39,6 +39,7 @@ for($i=0;$i<3;$i++){ print '.'; sleep(1); } +print "\n"; // read in mwEmbed.i18n.php $rawLangFile = file_get_contents( $mwLangFilePath ); @@ -99,26 +100,32 @@ function doJsonMerge( $json_txt ){ foreach( $jmsg as $k => $v ){ //check if the existing value is changed and merge and merge ->right if(isset( $messages['en'][$k] )){ - if($messages['en'][$k] != $v ) + if($messages['en'][$k] != $v ){ $doReplaceFlag=true; - //add the actual value: + print "'$k'does not match:\n" . $messages['en'][$k] . "\n!=\n" . $v . "\n"; + } + //add the actual value: (replace new lines (not compatible json) + //$jsMsgAry[$k] = str_replace("\n", '\\n', $messages['en'][$k]); $jsMsgAry[$k] = $messages['en'][$k]; $doReplaceFlag=true; }; $outPhp.="\t'{$k}' => '" . str_replace( '\'', '\\\'', $v ) . "',\n"; } //merge the jsLanguage array back in and wrap the output - if($mergeToJS){ + if($mergeToJS && $doReplaceFlag){ $json = json_encode($jsMsgAry ); $json_txt = jsonReadable($json); //escape $1 for preg replace: $json_txt = str_replace('$', '\$', $json_txt); + //print "json:\n$json_txt \n"; $str = preg_replace ('/loadGM\s*\(\s*{(.*)}\s*\)\s*/siU', "loadGM(" . $json_txt . ")", $jsFileText); + //print substr($str, 0, 600); + if( file_put_contents($fname, $str) ){ - print "updated $curFileName from php\n"; + print "\nupdated $curFileName from php\n\n"; }else{ die("could not write to: " . $fname); } @@ -159,7 +166,11 @@ function jsonReadable($json) { $result = trim($result) . $newline . str_repeat($tab, $tabcount) . $char; break; case ',': - $result .= $char . $newline . str_repeat($tab, $tabcount); + if($inquote){ + $result .= $char; + }else{ + $result .= $char . $newline . str_repeat($tab, $tabcount); + } break; case ':': $result .= ' ' . $char . ' '; -- 2.20.1